package com.wmh.baseservice.skd.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wmh.baseservice.skd.pojo.SkdPickupPointCategory;
import com.wmh.baseservice.skd.service.SkdPickupPointCategoryService;
import com.wmh.baseservice.skd.mapper.SkdPickupPointCategoryMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* @author CH
* @description 针对表【skd_pickup_point_category】的数据库操作Service实现
* @createDate 2023-12-28 10:15:30
*/
@Service
public class SkdPickupPointCategoryServiceImpl extends ServiceImpl<SkdPickupPointCategoryMapper, SkdPickupPointCategory>
    implements SkdPickupPointCategoryService{
    @Resource
    private SkdPickupPointCategoryMapper skdPickupPointCategoryMapper;
    @Override
    public List<Map<String, Object>> queryListByUsId(Long usId) {
        List<Map<String, Object>> list = new ArrayList<>();
        skdPickupPointCategoryMapper.selectList(new QueryWrapper<SkdPickupPointCategory>().eq("us_id", usId)).forEach(
            e -> {
                Map<String, Object> map = new HashMap<>();
                map.put("id", e.getId());
                map.put("pickupPointCategory", e.getName());
                list.add(map);
            }
        );
        return list;
    }
}




